 /* Copyright 2018 JDCLOUD.COM

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http:#www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.





Contact: 

NOTE: This class is auto generated by the jdcloud code generator program.
*/


#import <Foundation/Foundation.h>
#import <JDCloudOCSDKBaseanti/BaseantiModel.h>

@implementation IpCleanThresholdSpec
-(id) initWithIp:(NSString*) ip
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps { 
     self.ip = ip;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    return self;
}
 @end
@implementation IpResourceProtectInfo
-(id) initWithStartTime:(NSString*) startTime
      endTime:(NSString*)endTime
      status:(NSNumber*)status
      cause:(NSNumber*)cause { 
     self.startTime = startTime;               
     self.endTime = endTime;               
     self.status = status;               
     self.cause = cause;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self cause])
    {
        [result setValue:[self cause] forKey:@"cause"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.status = [dictionary objectForKey:@"status"];
    self.cause = [dictionary objectForKey:@"cause"];
    return self;
}
 @end
@implementation IpResource
-(id) initWithRegion:(NSString*) region
      resourceType:(NSNumber*)resourceType
      ip:(NSString*)ip
      bandwidth:(NSNumber*)bandwidth
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps
      blackHoleThreshold:(NSNumber*)blackHoleThreshold
      instanceId:(NSString*)instanceId
      instanceName:(NSString*)instanceName
      instanceType:(NSNumber*)instanceType
      safeStatus:(NSNumber*)safeStatus { 
     self.region = region;               
     self.resourceType = resourceType;               
     self.ip = ip;               
     self.bandwidth = bandwidth;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
     self.blackHoleThreshold = blackHoleThreshold;               
     self.instanceId = instanceId;               
     self.instanceName = instanceName;               
     self.instanceType = instanceType;               
     self.safeStatus = safeStatus;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self bandwidth])
    {
        [result setValue:[self bandwidth] forKey:@"bandwidth"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    if([self blackHoleThreshold])
    {
        [result setValue:[self blackHoleThreshold] forKey:@"blackHoleThreshold"];
    }
    if([self instanceId])
    {
        [result setValue:[self instanceId] forKey:@"instanceId"];
    }
    if([self instanceName])
    {
        [result setValue:[self instanceName] forKey:@"instanceName"];
    }
    if([self instanceType])
    {
        [result setValue:[self instanceType] forKey:@"instanceType"];
    }
    if([self safeStatus])
    {
        [result setValue:[self safeStatus] forKey:@"safeStatus"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.region = [dictionary objectForKey:@"region"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.ip = [dictionary objectForKey:@"ip"];
    self.bandwidth = [dictionary objectForKey:@"bandwidth"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    self.blackHoleThreshold = [dictionary objectForKey:@"blackHoleThreshold"];
    self.instanceId = [dictionary objectForKey:@"instanceId"];
    self.instanceName = [dictionary objectForKey:@"instanceName"];
    self.instanceType = [dictionary objectForKey:@"instanceType"];
    self.safeStatus = [dictionary objectForKey:@"safeStatus"];
    return self;
}
 @end
@implementation AttackTypeCount
-(id) initWithType:(NSString*) type
      count:(NSNumber*)count { 
     self.type = type;               
     self.count = count;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self type])
    {
        [result setValue:[self type] forKey:@"type"];
    }
    if([self count])
    {
        [result setValue:[self count] forKey:@"count"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.type = [dictionary objectForKey:@"type"];
    self.count = [dictionary objectForKey:@"count"];
    return self;
}
 @end
@implementation CleanThresholdSpec
-(id) initWithCleanThresholdBps:(NSNumber*) cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps { 
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    return self;
}
 @end
@implementation AttackLog
-(id) initWithIp:(NSString*) ip
      resourceType:(NSNumber*)resourceType
      attackLogId:(NSString*)attackLogId
      startTime:(NSString*)startTime
      endTime:(NSString*)endTime
      cause:(NSNumber*)cause
      status:(NSNumber*)status
      blackHole:(NSNumber*)blackHole
      peak:(NSNumber*)peak
      unit:(NSString*)unit
      attackType:(NSArray<NSString*>*)attackType { 
     self.ip = ip;               
     self.resourceType = resourceType;               
     self.attackLogId = attackLogId;               
     self.startTime = startTime;               
     self.endTime = endTime;               
     self.cause = cause;               
     self.status = status;               
     self.blackHole = blackHole;               
     self.peak = peak;               
     self.unit = unit;               
     self.attackType = attackType;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self resourceType])
    {
        [result setValue:[self resourceType] forKey:@"resourceType"];
    }
    if([self attackLogId])
    {
        [result setValue:[self attackLogId] forKey:@"attackLogId"];
    }
    if([self startTime])
    {
        [result setValue:[self startTime] forKey:@"startTime"];
    }
    if([self endTime])
    {
        [result setValue:[self endTime] forKey:@"endTime"];
    }
    if([self cause])
    {
        [result setValue:[self cause] forKey:@"cause"];
    }
    if([self status])
    {
        [result setValue:[self status] forKey:@"status"];
    }
    if([self blackHole])
    {
        [result setValue:[self blackHole] forKey:@"blackHole"];
    }
    if([self peak])
    {
        [result setValue:[self peak] forKey:@"peak"];
    }
    if([self unit])
    {
        [result setValue:[self unit] forKey:@"unit"];
    }
    if([self attackType])
    {
        [result setValue:[self attackType] forKey:@"attackType"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.resourceType = [dictionary objectForKey:@"resourceType"];
    self.attackLogId = [dictionary objectForKey:@"attackLogId"];
    self.startTime = [dictionary objectForKey:@"startTime"];
    self.endTime = [dictionary objectForKey:@"endTime"];
    self.cause = [dictionary objectForKey:@"cause"];
    self.status = [dictionary objectForKey:@"status"];
    self.blackHole = [dictionary objectForKey:@"blackHole"];
    self.peak = [dictionary objectForKey:@"peak"];
    self.unit = [dictionary objectForKey:@"unit"];
    self.attackType = [dictionary objectForKey:@"attackType"];
    return self;
}
 @end
@implementation IpSafetyInfo
-(id) initWithIp:(NSString*) ip
      safetyStatus:(NSNumber*)safetyStatus
      region:(NSString*)region
      blackHoleThreshold:(NSNumber*)blackHoleThreshold
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps { 
     self.ip = ip;               
     self.safetyStatus = safetyStatus;               
     self.region = region;               
     self.blackHoleThreshold = blackHoleThreshold;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self safetyStatus])
    {
        [result setValue:[self safetyStatus] forKey:@"safetyStatus"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self blackHoleThreshold])
    {
        [result setValue:[self blackHoleThreshold] forKey:@"blackHoleThreshold"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.safetyStatus = [dictionary objectForKey:@"safetyStatus"];
    self.region = [dictionary objectForKey:@"region"];
    self.blackHoleThreshold = [dictionary objectForKey:@"blackHoleThreshold"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    return self;
}
 @end
@implementation IpCleanThresholdRange
-(id) initWithIpCleanThresholdBpsMax:(NSNumber*) ipCleanThresholdBpsMax
      ipCleanThresholdBpsMin:(NSNumber*)ipCleanThresholdBpsMin
      ipCleanThresholdPpsMax:(NSNumber*)ipCleanThresholdPpsMax
      ipCleanThresholdPpsMin:(NSNumber*)ipCleanThresholdPpsMin { 
     self.ipCleanThresholdBpsMax = ipCleanThresholdBpsMax;               
     self.ipCleanThresholdBpsMin = ipCleanThresholdBpsMin;               
     self.ipCleanThresholdPpsMax = ipCleanThresholdPpsMax;               
     self.ipCleanThresholdPpsMin = ipCleanThresholdPpsMin;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ipCleanThresholdBpsMax])
    {
        [result setValue:[self ipCleanThresholdBpsMax] forKey:@"ipCleanThresholdBpsMax"];
    }
    if([self ipCleanThresholdBpsMin])
    {
        [result setValue:[self ipCleanThresholdBpsMin] forKey:@"ipCleanThresholdBpsMin"];
    }
    if([self ipCleanThresholdPpsMax])
    {
        [result setValue:[self ipCleanThresholdPpsMax] forKey:@"ipCleanThresholdPpsMax"];
    }
    if([self ipCleanThresholdPpsMin])
    {
        [result setValue:[self ipCleanThresholdPpsMin] forKey:@"ipCleanThresholdPpsMin"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ipCleanThresholdBpsMax = [dictionary objectForKey:@"ipCleanThresholdBpsMax"];
    self.ipCleanThresholdBpsMin = [dictionary objectForKey:@"ipCleanThresholdBpsMin"];
    self.ipCleanThresholdPpsMax = [dictionary objectForKey:@"ipCleanThresholdPpsMax"];
    self.ipCleanThresholdPpsMin = [dictionary objectForKey:@"ipCleanThresholdPpsMin"];
    return self;
}
 @end
@implementation IpResourceInfo
-(id) initWithIp:(NSString*) ip
      safeStatus:(NSNumber*)safeStatus
      region:(NSString*)region
      blackHoleThreshold:(NSNumber*)blackHoleThreshold
      cleanThresholdBps:(NSNumber*)cleanThresholdBps
      cleanThresholdPps:(NSNumber*)cleanThresholdPps { 
     self.ip = ip;               
     self.safeStatus = safeStatus;               
     self.region = region;               
     self.blackHoleThreshold = blackHoleThreshold;               
     self.cleanThresholdBps = cleanThresholdBps;               
     self.cleanThresholdPps = cleanThresholdPps;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self ip])
    {
        [result setValue:[self ip] forKey:@"ip"];
    }
    if([self safeStatus])
    {
        [result setValue:[self safeStatus] forKey:@"safeStatus"];
    }
    if([self region])
    {
        [result setValue:[self region] forKey:@"region"];
    }
    if([self blackHoleThreshold])
    {
        [result setValue:[self blackHoleThreshold] forKey:@"blackHoleThreshold"];
    }
    if([self cleanThresholdBps])
    {
        [result setValue:[self cleanThresholdBps] forKey:@"cleanThresholdBps"];
    }
    if([self cleanThresholdPps])
    {
        [result setValue:[self cleanThresholdPps] forKey:@"cleanThresholdPps"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.ip = [dictionary objectForKey:@"ip"];
    self.safeStatus = [dictionary objectForKey:@"safeStatus"];
    self.region = [dictionary objectForKey:@"region"];
    self.blackHoleThreshold = [dictionary objectForKey:@"blackHoleThreshold"];
    self.cleanThresholdBps = [dictionary objectForKey:@"cleanThresholdBps"];
    self.cleanThresholdPps = [dictionary objectForKey:@"cleanThresholdPps"];
    return self;
}
 @end
@implementation IpResourceFlow
-(id) initWithTime:(NSArray<NSString*>*) time
      postProtect:(NSArray<NSNumber*>*)postProtect
      preProtect:(NSArray<NSNumber*>*)preProtect
      unit:(NSString*)unit { 
     self.time = time;               
     self.postProtect = postProtect;               
     self.preProtect = preProtect;               
     self.unit = unit;               
    return self;
}

-(NSMutableDictionary*) dictionary{
    NSMutableDictionary* result = [[NSMutableDictionary alloc] init];
    if([self time])
    {
        [result setValue:[self time] forKey:@"time"];
    }
    if([self postProtect])
    {
        [result setValue:[self postProtect] forKey:@"postProtect"];
    }
    if([self preProtect])
    {
        [result setValue:[self preProtect] forKey:@"preProtect"];
    }
    if([self unit])
    {
        [result setValue:[self unit] forKey:@"unit"];
    }
    return result;
}

-(id) initWithDic:(NSDictionary*)dictionary{
    self.time = [dictionary objectForKey:@"time"];
    self.postProtect = [dictionary objectForKey:@"postProtect"];
    self.preProtect = [dictionary objectForKey:@"preProtect"];
    self.unit = [dictionary objectForKey:@"unit"];
    return self;
}
 @end
 
 


